import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import quickActions from '@/views/quickActions/index.vue'
import order from '@/views/order/index.vue'
import product from '@/views/product/index.vue'
import produce from '@/views/produce/index.vue'
import customer from '@/views/customer/index.vue'
import mold from '@/views/mold/index.vue'
import output from '@/views/output/index.vue'
import supplier from '@/views/supplier/index.vue'
import queryPage from '@/components/modules/queryPage.vue'
import shipment from '@/views/shipment/index.vue'
import receipt from '@/views/receipt/index.vue'
import pieceRateWage from '@/views/pieceRateWage/index.vue'
import process from '@/views/process/index.vue'
import employee from '@/views/employee/index.vue'
import statistics from '@/views/statistics/index.vue'
import customerAmount from '@/views/statistics/customerAmount.vue'
import customerPayment from '@/views/statistics/customerPayment.vue'
import customerQuantity from '@/views/statistics/customerQuantity.vue'
import productQuantity from '@/views/statistics/productQuantity.vue'
import saleOrderQuantity from '@/views/statistics/saleOrderQuantity.vue'
import shiftOutput from '@/views/statistics/shiftOutput.vue'
const constantRouterMap = [
  {
    path: '/', component: () => import('@/views/home/index.vue'), redirect: '/quickActions', children: [
      { path: '/quickActions', name: '主页', component: quickActions },
      { path: '/statistics', name: '统计图表', component: statistics },
      { path: '/user', name: '我的', component: () => import('@/views/user/index') }
    ]
  },
  { path: '/produce', name: '生产', component: produce },
  { path: '/product', name: '产品', component: product },
  { path: '/shipment', name: '送货单', component: shipment },
  { path: '/receipt', name: '回款', component: receipt },
  { path: '/pieceRateWage', name: '计件工资', component: pieceRateWage },
  { path: '/mold', name: '模具', component: mold },
  { path: '/output', name: '产量登记', component: output },
  { path: '/order', name: '订单', component: order },
  { path: '/customer', name: '客户', component: customer },
  { path: '/supplier', name: '供应商', component: supplier },
  { path: '/process', name: '工序管理', component: process },
  { path: '/employee', name: '员工管理', component: employee },
  { path: '/query', name: '通用查询', component: queryPage },
  { path: '/statistics/customerAmount', name: '统计图表', component: customerAmount },
  { path: '/statistics/customerPayment', name: '统计图表', component: customerPayment },
  { path: '/statistics/customerQuantity', name: '统计图表', component: customerQuantity },
  { path: '/statistics/productQuantity', name: '统计图表', component: productQuantity },
  { path: '/statistics/saleOrderQuantity', name: '统计图表', component: saleOrderQuantity },
  { path: '/statistics/shiftOutput', name: '统计图表', component: shiftOutput },
  { path: '/login', name: '登录', component: () => import('@/views/login/index') }
]
const router = new VueRouter({
  mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})

export default router
